public class MyArrayListTest {
    public static void main(String[] args) {
        MyArrayList list = new MyArrayList();
        System.out.println(list.size());   //0
        System.out.println(list.isEmpty());  //true

        list.add("喜羊羊");
        list.add("灰太狼");
        list.add("大灰狼");
        list.add(1,"美羊羊");
        list.add("香蕉");
        list.add("荔枝");
        list.add("喜羊羊");
        list.add("灰太狼");
        list.add("大灰狼");
        list.add(1,"美羊羊");
        list.add("香蕉");
        list.add("荔枝");
        System.out.println(list);
//        System.out.println(list.contains("香蕉"));  //true
//        System.out.println(list.contains(8));  //false
//        System.out.println(list.get(7));   //喜羊羊
//        System.out.println(list.isEmpty());  //false
//        System.out.println(list.indexOf("美羊羊"));   //-1
//        System.out.println(list.indexOf("大灰狼"));   // 4
//        list.add(0,null);
//        System.out.println(list);
//        System.out.println(list.indexOf(null));  //0
//        System.out.println(list.contains("荔枝")); //true
////        System.out.println(list.contains(null)); //报错
//
//        list.set(0,1);
//        System.out.println(list);  //1
        System.out.println(list.indexOf("香蕉")); //索引 5
        System.out.println(list.remove("香蕉"));
        System.out.println(list);
        System.out.println(list.remove(1));
        System.out.println(list);
        list.clear();
        System.out.println(list);


    }
}
